package com.knowif.pojo;

import java.util.Date;

import javax.validation.constraints.NotEmpty;

import org.springframework.validation.annotation.Validated;

import com.fasterxml.jackson.annotation.JsonFormat;

@Validated
public class Item {
    private Integer id;

    private String createPeople;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    private String delPeople;

    private Integer isDel;
   
    @NotEmpty(message = "item图片不能为空")
    private String itemPic;

    @NotEmpty(message = "item名字不能为空")
    private String itemName;

    @NotEmpty(message = "item链接不能为空")
    private String linkUrl;

    private Integer parentId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCreatePeople() {
        return createPeople;
    }

    public void setCreatePeople(String createPeople) {
        this.createPeople = createPeople == null ? null : createPeople.trim();
    }

    public Date getCreateTime() {
    	if(createTime == null){
    		createTime = new Date();
    	}
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getDelPeople() {
        return delPeople;
    }

    public void setDelPeople(String delPeople) {
        this.delPeople = delPeople == null ? null : delPeople.trim();
    }

    public Integer getIsDel() {
        return isDel;
    }

    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }

    public String getItemPic() {
        return itemPic;
    }

    public void setItemPic(String itemPic) {
        this.itemPic = itemPic == null ? null : itemPic.trim();
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public String getLinkUrl() {
        return linkUrl;
    }

    public void setLinkUrl(String linkUrl) {
        this.linkUrl = linkUrl == null ? null : linkUrl.trim();
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }
  

	@Override
	public String toString() {
		return "Item [id=" + id + ", createPeople=" + createPeople + ", createTime=" + createTime + ", delPeople="
				+ delPeople + ", isDel=" + isDel + ", itemPic=" + itemPic + ", itemName=" + itemName + ", linkUrl="
				+ linkUrl + ", parentId=" + parentId + "]";
	}
}